const path = require("path");
const NODE_ENV = process.env.NODE_ENV;

module.exports = {
  pages: {
    index: {
      entry: NODE_ENV === "development" ? "examples/main.js" : "src/index.js",
      template: "public/index.html",
      filename: "index.html",
    },
  },
  chainWebpack: (config) => {
    config.resolve.alias.set("@", path.join(__dirname, "examples"));
    config.module
      .rule(/\.jsx|.js$/)
      .include.add("/packages")
      .end()
      .use("babel")
      .loader("babel-loader")
      .tap((options) => {
        return options;
      });
  },
  css: {
    extract: false,
  },
  lintOnSave: false,
};
